(function($){
$.extend({
    cookie:function(name){
                if(name){
                    //获取cookie字符串
                    var strCookie=document.cookie;
                    var arrCookie=strCookie.split("; ");
                    for(var i=0;i<arrCookie.length;i++){
                        var arr=arrCookie[i].split("=");
                        if(name==arr[0]){
                            return arr[1];
                        }
                    }
                }
            }
});
})($);